package routers

import (
	"docker_go/internal/controller"
	"github.com/gin-gonic/gin"
)

func NewRouter() *gin.Engine {
	r := gin.New()
	r.Use(gin.Logger())
	r.Use(gin.Recovery())
	studentController := controller.NewStudentController()
	r.GET("/ping", studentController.Pong)
	v1 := r.Group("/api/v1")
	r.Use()
	{
		v1.GET("/students", studentController.GetAll)
		v1.POST("/students", studentController.InsertStudent)
	}
	return r
}
